@extends('layouts.app')

@section('content-header')
@endsection
@section('content')
<style>
    .profile-avatar-container {
        position: relative;
        width: 100px;
        margin: 0 auto;
    }

    .profile-avatar-container .profile-user-img {
        width: 100px;
        height: 100px;
    }

    .profile-avatar-container .profile-avatar-text {
        display: none;
    }

    .profile-avatar-container:hover .profile-avatar-text {
        display: block;
        position: absolute;
        height: 100px;
        width: 100px;
        background: #444;
        opacity: .6;
        color: #fff;
        top: 0;
        left: 0;
        line-height: 100px;
        text-align: center;
    }

    .profile-avatar-container button {
        position: absolute;
        top: 0;
        left: 0;
        width: 100px;
        height: 100px;
        opacity: 0;
    }
</style>
    <div class="content">
        <div class="box-header with-border">
            <div class="row">
                <div class="lockscreen-wrapper" style="margin-top:0">
                    <div class="box box-success">
                        <div class="panel-heading">
                            修改密码
                        </div>
                        <div class="panel-body">

                            <form id="update-form" role="form" method="POST" action="{{ route('admin.password.update') }}">
                                <div class="box-body box-profile">

                                    <input type="hidden" name="_token" value="{{ csrf_token() }}" />
                                    <div class="profile-avatar-container">
                                        <img class="profile-user-img img-responsive img-circle" src="{{ \Illuminate\Support\Facades\Auth::user()->avatar }}" onerror="this.src='https://oss-frakiss.oss-cn-chengdu.aliyuncs.com/avatar/default-avatar.png'"  alt="">
                                    </div>

                                    <h3 class="profile-username text-center">{{ \Illuminate\Support\Facades\Auth::user()->name }}</h3>

                                    <div class="form-group">
                                        <label for="username" class="control-label">请输入原密码</label>
                                        <input type="password" class="form-control" name="old_pwd" placeholder="请输入原密码" />
                                    </div>

                                    <div class="form-group">
                                        <label for="username" class="control-label">请输入新密码</label>
                                        <input type="password" class="form-control" name="new_pwd" placeholder="请输入新密码" />
                                    </div>

                                    <div class="form-group">
                                        <label for="username" class="control-label">请再次输入密码</label>
                                        <input type="password" class="form-control" name="re_pwd" placeholder="请再次输入密码" />
                                    </div>
                                    
                                    <div class="form-group">
                                        <button type="submit" class="btn btn-success">确定</button>
                                        <a class="btn btn-primary btn-xs examine" href="javascript:;" style="float: right;" >忘记密码？</a>
                                    </div>

                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal fade loading custom-hide" id="hideFormSystem" tabindex="-1" role="dialog"
             aria-labelledby="hideFormLibelSystem" aria-hidden="true" data-backdrop="static" data-keyboard="false">
            <div class="modal-dialog">
                <div class="invoice" style="text-align: center">
                    <div class="form-group">
                        请联系甲方管理人员重置密码！
                    </div>
                    <br>
                    <div class="form-group">
                        <button type="button" class="btn" id="closeHideFormSystem">关闭</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
@push('scripts')
    <script>

       
        $('.examine').on('click', function () {
            $("#hideFormSystem form").attr('action', $(this).attr('data-url'));
            $("#system_reply").val($(this).attr('data-system-reply'))
            $("#hideFormSystem").modal('show');
        });
        $('#closeHideFormSystem').on('click', function () {
            $("#hideFormSystem").modal('hide');
        });
        
    </script>
@endpush